import { ChainBO } from 'pages/tree/model/Interfaces';

export class TreeBO {
  current: ChainBO
  childs: TreeBO[] = []
  constructor(inCurrent: ChainBO, dataSet: ChainBO[]) {
    this.current = inCurrent;
    const chainTail = inCurrent.relationNode.chainTail;
    dataSet.forEach(x => {
      const chainHead = x.relationNode.chainHead;
      if (chainHead === chainTail)
        this.childs.push(new TreeBO(x, dataSet))
      });
  }
}

